<template>
	<view>
		<global-navgation title="分享系统"></global-navgation>
		<view class="rule" v-html="lists.content">
			
		</view>
		<view class="submit">
			<button type="default" @click="popup">立即申请成为推广员</button>
		</view>
		
		<view class="popup" v-if="isShow">
			<view style="width: 100%;height: 764rpx;" @click="isShow=false"></view>
			<view class="apply">
				<view class="title">申请资料<text class="iconfont icon-x icon" @click="isShow=false"></text></view>
				<view class="line"></view>
				
				<view class="info">
					<label for="name">姓名<image src="../../../static/images/48.png" lazy-load="true"></image></label>
					<input type="text" value="" placeholder="请输入姓名" id="name" v-model="name"/>
				</view>
				
				<view class="info">
					<label for="phone" style="padding-top: 0;">手机号<image src="../../../static/images/48.png" lazy-load="true"></image></label>
					<input type="text" value="" placeholder="请输入手机号" id="phone" v-model="mobile"/>
					<input type="text" value="" placeholder="请输入验证码" v-model="codes"/>
					<view class="verify">
						<text>|</text><text @click="code">获取验证码</text>
					</view>
				</view>
				
				<view class="submit">
					<button type="default" @click="post">提交</button>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import globalNavgation from '../../../components/globalNavgation.vue'
	export default {
		components: {
			globalNavgation
		},
		data() {
			return {
				isShow:false,
				lists:[],
				tokens:"",
				name:'',
				mobile:'',
				codes  :"",
				content:""
			}
		},
		onLoad(){
			uni.getStorage({
			    key: 'token',
			    success:  res=> {
					this.tokens=res.data
					console.log('mmm',this.tokens)
			    }
			});
		},
		mounted() {
			// 初始化获取数据
			this.__initClassData()			
		},
		methods: {
			popup(){
				this.isShow=!this.isShow
			},
			code(){
				alert(456)
				this.$api.post({
					url: '/verify/verify_code/code',
					data:{token:this.tokens,name:this.name,mobile:this.mobile,code_type:'distribution'}
				}).then(res => {
						this.lists=res.data
						
						
						console.log('ccc',res)
					})
			},
			post(){
				alert(123)
				this.$api.post({
					url: '/distribution/distributer_user/add',
					data:{token:this.tokens,name:this.name,mobile:this.mobile,code_type:'distribution',code:this.codes}
				}).then(res => {
						this.lists=res.data
						
						
						console.log('ttt',res)
					})
			},
			__initClassData() {
				this.$api.get({
					url: '/article/article/distribution',
					data:{token:this.tokens}
				}).then(res => {
						this.lists=res.data
						
						
						console.log("999",res)
					})
				},
		}
	}
</script>

<style scoped>
	.rule {
		width: 686rpx;
		height: 1302rpx;
		margin: 0 auto;
		/* background-color: #007AFF; */
		font-family: PingFang SC;
		font-style: normal;
		font-weight: 600;
		font-size: 32rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.rule .rule-item {
		padding-top: 40rpx;
	}

	.rule .rule-item .rule-content {
		margin-top: 24rpx;
		font-weight: normal;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.9);
		opacity: 0.8;
		text-align: justify;
	}
	
	.rule .rule-item:first-child{
		font-size: 44rpx;
	}
	
	.rule image{
		width: 100%;
		height: 384rpx;
		margin: 0 auto;
		margin-top: 18rpx;
	}
	
	.submit{
		width: 100%;
		height: 140rpx;
		position: fixed;
		bottom: 0;
		box-shadow: 0px -2px 8px rgba(0, 0, 0, 0.08);
	}
	.submit button{
		margin-top: 20rpx;
		width:686rpx;
		height: 100rpx;
		text-align: center;
		line-height: 100rpx;
		font-family: PingFang SC;
		font-style: normal;
		font-weight: normal;
		font-size: 36rpx;
		color: #F7F7F7;
		background: linear-gradient(90deg, #3965FF 0%, rgba(57, 101, 255, 0.8) 100%);
		border-radius: 4px;
	}
	
	.popup{
		position: absolute;
		width: 100%;
		height: 1624rpx;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
	}
	
	.popup .apply{
		width: 100%;
		height: 860rpx;
		background-color: #FFFFFF;
		border-radius: 16px 16px 0px 0px;
		position: fixed;
		bottom: 0;
	}
	
	.popup .apply .title{
		position: relative;
		text-align: center;
		margin-top: 40rpx;
		font-family: PingFang SC;
		font-style: normal;
		font-weight: 550;
		font-size: 36rpx;
		color: #000000;
	}
	
	.popup .apply .info{
		font-family: PingFang SC;
		font-style: normal;
		font-weight: normal;
		font-size: 32rpx;
		color: rgba(0, 0, 0, 0.85);
		height: 242rpx;
		width: 100%;
		position: relative;
	}
	
	.popup .apply .info .verify{
		position: absolute;
		bottom: -16rpx;
		right: 75rpx;
		height: 88rpx;
		line-height: 88rpx;
	}
	
	.popup .apply .info .verify text:first-child{
		margin-right: 32rpx;
		color:  #E5E5E5;
	}
	
	.popup .apply .info .verify text:nth-child(2){
		color: #3965FF;
	}
	
	.popup .apply .info label{
		display: block;
		padding-top:46rpx;
		font-weight: 550;
		padding-left: 32rpx;
		color: rgba(0, 0, 0, 0.9);
	}
	
	.popup .apply .info image{
		width: 10.6rpx;
		height: 11.4rpx;
		margin-left: 10rpx;
		vertical-align: middle;
	}
	
	.popup .apply .info input{
		width: 638rpx;
		height: 88rpx;
		margin: 0 auto;
		border: 3rpx solid rgba(0, 0, 0, 0.15);
		border-radius: 10rpx;
		margin-top: 16rpx;
		padding: 0 24rpx;
		color: rgba(0, 0, 0, 0.9);
	}
	
	.popup .apply .title .icon {
		position: absolute;
		top: 4rpx;
		right: 32rpx;
		font-size: 40rpx;
		color: #C4C4C4;
	}
	
	.popup .apply .line{
		margin-top: 32rpx;
		width: 100%;
		height: 2rpx;
		background: #F2F2F2;
	}
</style>